package pe.com.cineplanet.config;

import java.io.InputStream;
import java.util.Properties;


public class Propiedades extends Properties {
	
	private static final long serialVersionUID = -8051669870650372795L;
	private static Propiedades instance;
	
	public static Propiedades getInstance() {
	      if (instance != null) {
	         return instance;
	      } else {
	         makeInstance();
	         return instance;
	      }
	   }
	
	private static synchronized void makeInstance() {
	      if (instance == null) {
	         instance = new Propiedades();
	      }
	   }
	
	private Propiedades() {
		  //valores por defecto
		  try {
			  
			  InputStream is = Propiedades.class.getResourceAsStream("../listener/cineplanet.properties");
			  load(is);
	      } catch (Exception e) {
	    	  e.printStackTrace();
	    	  return;
	      }
	   }
	
	static public String getValue(String Key){
		String valor="";
		valor=Propiedades.getInstance().getProperty(Key);
		return valor;
	}
	static public int getInteger(String Key){
		return Integer.parseInt(Propiedades.getInstance().getProperty(Key));
	}
	
}



